import 'package:flutter/material.dart';
import 'dart:ui';
import 'package:city_corner/commons/top-panel.dart';
import 'package:city_corner/detail-page/bottom-panel.dart';
import 'package:city_corner/detail-page/publisher.dart';
import 'package:city_corner/detail-page/recommend.dart';
import 'house-info.dart';
import 'swiper-area.dart';
import 'house-desc/index.dart';

class DetailPage extends StatefulWidget {
  final String id;
  DetailPage({this.id});

  @override
  State<StatefulWidget> createState() {
    return _DetailPage();
  }
}

class _DetailPage extends State<DetailPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(children: [
      Container(
          padding: EdgeInsets.only(bottom: 60.0),
          child: CustomScrollView(
            slivers: [
              SliverList(
                  delegate: SliverChildBuilderDelegate((context, index) {
                return Container(
                  child: Column(
                    children: [
                      SwiperArea(),
                      Container(
                          child: Column(children: [
                        HouseDesc(),
                        HouseInfo(),
                        Publisher(),
                        Recommend()
                      ]))
                    ],
                  ),
                );
              }, childCount: 1))
            ],
          )),
      Positioned(
        child: TopPanel(),
        top: MediaQueryData.fromWindow(window).padding.top + 10,
      ),
      Positioned(child: BottomPanel(), bottom: 0)
    ]));
  }
}
